<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>伪造AJAX</title>
</head>
<body>
<script type="text/javascript">
    // <!--window.onload() 方法用于在网页加载完毕后立刻执行的操作，即当 HTML 文档加载完毕后，立刻执行某个方法。-->
    window.onload = function () {
        let myDate = new Date();
        document.getElementById('currentTime').innerText = myDate.getTime();
    };

    function LoadPage() {
        let targetUrl = document.getElementById('url').value;
        console.log(targetUrl);
        document.getElementById("iframePosition").src = targetUrl;
    }
</script>

<div>
    <p>请输入要加载的地址：<span id="currentTime"></span></p>
    <p>
        <label for="url">
            <input id="url" type="text" value="https://ubisoftconnect.com/zh-CN"/>
        </label>
        <input type="button" value="提交" onclick="LoadPage()"/>
    </p>
</div>

<div>
    <h3>加载页面位置：</h3>
    <iframe id="iframePosition" style="width: 100%;height: 500px;"></iframe>
</div>
</body>
</html>